 

import Control.TradeController;
import Model.*;
/**
 * UI to add or edit Items for Rents and Orders (NOT DONE, can't fix)
 * @author Stefan
 */
public class ItemsUI
{

    public void start(String ID)
    {
        //orderMenu(ID);
    }

//    private void orderMenu(String ID)
//    {
//        boolean exit = false;
//        while (!exit)
//        {
//            int choise = writeItemMenu();
//            if (choise == 1)
//            {
//                startAdd();
//            }
//            else if (choise == 2)
//            {
//                startDelete();
//            }
//            else if (choise == 3)
//            {
//            }
//            else if (choise == 4)
//            {
//            }
//            else
//            {
//                exit = true;
//            }
//        }
//    }

    private int writeItemMenu()
    {
        System.out.println("\n\f *** Items Menu ***");
        System.out.println("\f Choose one to edit");
        System.out.println(" (1) Add item to order");
        System.out.println(" (2) Remove item from order");
        System.out.println(" (3) Update item from order");
        System.out.println(" (0) Back");

        return CommonUIFunctions.readInt("\n Make your choise: ");
    }

//    private void getInfo(String ID)
//    {
//        int i = 0;
//        System.out.println("Items on order");
//        for (SalesLineItem item : ord.getSaleLines())
//        {
//            i++;
//            System.out.println("Nr: " + i + ": " + item.getProduct().getName() + ": " + item.getQuantity() + " - " + item.subTotalPrice());
//        }
//    }

    private void startAdd(String ID)
    {
        try
        {
            
        } catch (Exception e)
        {
            System.out.println("There was no item with this ID: " + (ID));
        }
    }

//    private void startDelete(String ID)
//    {
//        try
//        {
//            getInfo(ID);
//            ord.deleteSaleslineItem(null);
//            System.out.println("Trade " + (ID) + " was deleted");
//        } catch (Exception e)
//        {
//            System.out.println("There was no trade with this ID: " + (ID));
//        }
//    }
}
